<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/app/include.jsp"%>
		<script type="text/javascript">
			// 添加用户信息
			function add(){
				var fromUrl = "${pageContext.request.contextPath}/app/module/user/insert-one-user.jsp";
				var toUrl = "${pageContext.request.contextPath}/auth/user/addOneUser.do";
				var title = "新增用户信息";
				Tool.showSaveDialog(fromUrl,toUrl,title,500,200);
			}
			
			// 修改用户信息
			function edit(userid){
				var fromUrl = "${pageContext.request.contextPath}/auth/user/selectOneUser.do?userid=" + userid;
				var toUrl = "${pageContext.request.contextPath}/auth/user/editOneUser.do";
				var title = "修改用户信息";
				Tool.showUpdateDialog(fromUrl,toUrl,title,500,200);
			}
			
			// 删除用户信息
			function del(userid){
				var url = "${pageContext.request.contextPath}/auth/user/delOneUser.do";
				var params = {
					"userid" : userid
				};
				Tool.del(url,params);
			}
		</script>
	</head>
	<body>
		<div class="right_content">
			<div class="breadcrumb">
				<ul>
					<li>
						系统管理
						<span>/</span>
					</li>
					<li class="active">
						用户管理
					</li>
				</ul>
			</div>
			<div class="pull">
				<form id="queryForm" name="queryForm"
					action="${pageContext.request.contextPath}/auth/user/loadUserList.do"
					method="post">
					<div class="pull-left">
						姓名：
						<input name="userName" type="text" style="width: 240px;"
							value="${userName}" />
						帐号：
						<input name="loginId" type="text" style="width: 240px;"
							value="${loginId}" />
					</div>
					<div class="pull-right">
						<input type="button" class="btn btn-primary" value="查询"
							onclick="Page.queryPage();" />
						<input type="button" class="btn btn-primary" value="重置"
							onclick="Page.clearForm();" />
						<input type="button" onclick="add();" class="btn btn-primary"
							value="创建帐号" />
					</div>
				</form>
			</div>
			<div class="table-wrap">
				<table border="0" cellpadding="0" cellspacing="0" class="list">
					<thead>
						<tr>
							<th width="5%">
								序号
							</th>
							<th width="10%">
								帐号
							</th>
							<th width="15%">
								姓名
							</th>
							<th width="*">
								账户权限
							</th>
							<th width="15%">
								创建日期
							</th>
							<th width="10%">
								修改
							</th>
							<th width="10%">
								删除
							</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="result" items="${page.list}" varStatus="status">
							<tr>
								<td>
									${status.index + 1 }
								</td>
								<td>
									${result.loginid}
								</td>
								<td>
									${result.username}
								</td>
								<td></td>
								<td>
									${result.createdate}
								</td>
								<td>
									<a href="javaScript:edit('${result.id}');">修改</a>
								</td>
								<td>
									<a href="javaScript:del('${result.id}');">删除</a>
								</td>
							</tr>
						</c:forEach>
						<c:if test="${fn:length(page.list) == 0}">
							<tr>
								<td colspan=7 align="center">
									<font color=red><strong>当前没有人员信息！</strong>
									</font>
								</td>
							</tr>
						</c:if>
					</tbody>
				</table>
			</div>
			<!--分页开始-->
			${page.operate }
			<!--/分页结束-->
		</div>
	</body>
</html>
